package redis

import scala.language.postfixOps
import io.gatling.core.Predef._
import io.gatling.core.structure.ScenarioBuilder
import io.gatling.extensions.redis.Predef._
import io.gatling.extensions.redis.protocol.RedisProtocolBuilder

import scala.concurrent.duration._

class RedisTestCase extends Simulation {

  val protoal: RedisProtocolBuilder = redis_protocol("192.168.106.149", 19000, "lmCBngJk3jSBsPBS7GnH")

  val scn: ScenarioBuilder = scenario("test").forever(
    exec(redis("test")
      // todo 这里的check有点问题
//      .check(stringLength is 10)
    )
  )

  setUp(scn.inject(atOnceUsers(1)).throttle(
    jumpToRps(10),
    holdFor(1 minutes)
  )).protocols(protoal)
}
